\documentstyle[11pt,titlepage]{article}

\newcommand{\vault}{{\em The Vault}}
\newcommand{\key}{{\em The Key}}

\title{The Vault and The Key}

\author{Robert Fischer}
\date{February 17, 1990}

\begin{document}

\pagenumbering{roman}

\maketitle

\vfill
{\sf
User's Guide for \vault\ version 2.01 and \key\ version 1.1.
Manual version 1.0.

This manual and the programs it describes are copyright \copyright
1987--1990 by Robert P. Fischer.  Permission is granted to reproduce
this document in any form.  It may not be changed except to alter its
layout for printing.  No copy of this document, in machine-readable or
other format, may be sold for profit, but it may copied freely for
non-commercial purposes. 

The programs that this manual describes are also copyright \copyright
1987--1990.  They may be given away under certain conditions.  Run the
programs for more details.

This manual and the programs it describes are distributed in the hope
that they will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.  In particular, no warranty is made about the accuracy of
this manual.  You assume all risks of using these products.  The
author is not responsible for damages arising from use of this manual
or the programs it describes, whether caused by negligence or other
fault on the part of the author, or by any other cause. 
}
\vfill
\newpage

\tableofcontents

\newpage

\section{Introduction}

\pagenumbering{arabic}

\vault, and \key\ are two programs which help you get
more out of your hard and floppy disks.  \vault\ backs up your
hard disk in almost no time at all, and \key\ restores your
hard disk in case of a crash. 

\section{\vault : A Hard Disk Backup Program}


\subsection{Introduction}

\vault\ has one purpose -- to protect your valuable 
programs and data on a hard disk from loss.  A hard disk must be 
backed up frequently because its files can be lost at any time 
without warning.  \vault\ automates and speeds up the backup 
process, reducing the chance for human error and making it easy 
for you to do on a regular basis.

\vault\ is special because of its advanced user interface 
and integrated floppy disk caching scheme which speeds up the 
writing of backup disks.  It is totally GEM-based and contains a 
comprehensive help system.  It is easy to use and guides you 
through correct operation of the program.  It creates ordinary TOS 
disks, complete with file directories, so that individual files 
can be examined or restored at will.  It has an incremental mode 
that automatically backs up only those files that have changed 
since the last backup.  If run regularly, incremental backups are 
generally very fast and offer the best possible protection for 
your data.
 
Some other special qualities of \vault\ are:

\begin{itemize}
\item
It doesn't require large amounts of memory and will run quite 
 satisfactorily on a 512K machine, even with desk accessories 
 and/or a moderate sized ramdisk in place.

  \item \vault\ can back up files that are too large to fit on a 
 single floppy.  Such files are split into as many pieces as 
 necessary and each piece written to a floppy.  The pieces 
 themselves are ordinary files and contain a header line that 
 allows the restore program to insure that all pieces are 
 reassembled in the proper order.

  \item \vault\ uses a clever disk packing algorithm which 
 minimizes the need to split files and can usually fill a disk      
 to within a few thousand bytes.  Often, it fills a disk 
 completely without splitting a single file!

  \item \vault\ does a significant amount of input error checking, 
 keeping you from accidently inserting the wrong disk or from 
 wiping out the data you are trying to protect.

  \item \vault\ maintains a history file on the hard disk that lets 
 you quickly locate which disk a file is backed up on and when 
 it was written.  It also uses the history file itself to make 
 incremental backups virtually automatic.

\item Best of all, \vault\ is {\em FAST}.  It writes files almost
as quickly as the floppy drive can move its read/write head.  This
speed makes it feasible for you to use \vault\ every day, not just
when you have a few hours to kill during special occasions.  Remember,
\vault\ will help you protect your valuable files, but only if you
use it! 

\end{itemize}

\subsection{Why Back Up a Hard Disk?}

A backup program takes care of copying files to backup disks, 
but you must take care of those disks and make sure that you don't 
inadvertently destroy data.  To do this effectively requires that 
you understand the kinds of things that can happen to your data 
and that you set up systematic procedures for managing your backup 
disks.  We suggest some procedures below, along with a description 
of some of the hazards to which your data is subject.

\subsubsection{How to Lose Data}
\label{losingdata}

Data can be lost in many ways.  The most common mishap is for 
you to accidentally delete one or more files you wanted to keep.  
This can happen to anyone in a distracted moment, through 
confusion, or because of bugs in the software you are using.  The 
damage from this kind of error is normally confined to a small 
number of files, but it can be quite devastating when it occurs.

Less frequent but far more catastrophic are errors that 
damage the entire disk.  Power surges or other power failures 
while the drive is in the middle of writing can cause this to 
happen.  Normally only the file you were writing will be lost, but 
if the allocation tables or directories become corrupted, other 
files files in the same folder or partition may be lost as well. 
Worse still, the head may ``crash", ruining not just the data on 
the hard disk, but also the hard disk itself.  The disk can be 
repaired or replaced, but the data is lost forever -- unless you 
have used \vault.

Data can be lost even when the computer is not turned on.  
A hard disk can be damaged by a hard bump and will almost 
certainly not survive a drop to the floor.  Bits on the medium can 
sometimes randomly change, perhaps as a result cosmic radiation or 
strong magnetic fields.

Floppies too are vulnerable to many hazards.  Even though 
they appear rugged, floppies have been ruined just by being placed 
next to a ringing telephone.  Leaving them in the sun, spilling 
coffee on them or simply misplacing them can all lead to loss of 
data.  The magnetic medium may also be substandard or worn.

Although some of these possibilities seem unlikely, they all 
have happened.  The message is clear -- if you want to be assured 
that your data is safe, {\em you must have at least two copies of your 
data at all times.  Moreover, at least one copy must always be in 
a safe environment, out of the machine.}  It follows that you 
need two sets of backup disks so that the one can be kept in a 
safe place while the second is being written.

Backing up may take extra time, but the insurance is well 
worth it.  Like all insurance, you don't need it until a loss 
occurs, and then it is too late to start using \vault.


\subsubsection{Strategies for Backing Up}

\vault\ lets you do three kinds of backups.  A {\em full backup}
copies all the files on the disk.  It often takes a long time because
a hard disk stores a lot of information.  It should be done initially
and then from time to time whenever a clean copy of everything on the
hard disk is desired. 

Backups should be done frequently, but the files on a disk 
change slowly.  Most of the time, only a small part of the hard 
disk changes between backups, making it redundant and wasteful of 
time to always do a full backup.  A {\em daily incremental} copies only 
those files that have changed since the last full or incremental 
backup and is generally quite fast.

After many daily incremental backups have been done, the 
incremental backup disks may contain many copies of frequently 
changing files.  This takes up valuable disk space and makes it 
harder to find the most recent version of a file should it need to 
be restored.  When that happens, a {\em cleanup incremental} backup can 
be used to ``clean up" and reorganize the several disks full of 
incremental backups, writing out the current version of every file 
that has changed since the last full backup (rather than since the 
last incremental backup).  If the incremental backups still use 
too many floppies, it is time to make another full backup.
 

\subsubsection{Organizing Your Backup Disks}
\label{organize}

Since a hard disk is many times the size of a floppy disk, it 
takes many floppies to back up a hard disk.  This set of disks is 
called a {\em backup set}.  Each disk in a backup set is identified by 
a {\em disk name} consisting of a {\em backup set name} and a {\em volume number}.  
If the backup set is called BACKA, the first disk in the backup 
set would be called BACKA.\$01, the second would be BACKA.\$02, and 
so forth.

The disk name is written on the disk by \vault\ and checked 
during subsequent backups to make sure the proper disk has been 
inserted.  You should also label the floppy the same way so you 
can easily identify it later.

As mentioned in Section~\ref{losingdata}, keeping only one backup
set is not enough to provide full protection.  If you are backing up
the hard drive with your only backup set in the floppy drive and you
discover an error with a file on the hard disk or the hard disk
crashes, you are out of luck, for there is no complete backup set from
which you can restore your hard disk files. 

Thus, you should have two backup sets for full backups, and 
they should be rotated.  The first time you do a full backup, you 
should use set 1.  The next time, use set 2, the next time, set 1 
again, and so on.

For even greater protection, you might consider having a 
third ``disaster backup set" which you only write occasionally and 
then put into safe storage, preferably at another location.  Not 
only does this provide protection again disasters such as fire, 
but it also offers some protection against hidden errors.  
Sometimes a file might become corrupted but the error not 
discovered until weeks later when the file is used.  If you have 
been faithfully backing up your hard disk and rotating among the 
two backup sets for full backups, the corrupted file will 
eventually be propagated to all of your backup disks, and when you 
go to recover it, all you will find is several copies of the same
bad file.

To successfully rotate your backup sets, you must remember 
which one was used last.  If you keep your backup disks in a box, 
put the most recently used set in the front and you will 
never forget which one was used last.  If you do get mixed up, you 
can look in the history file on the hard disk (\_BACKUP.HST or 
\_BACKUP.CTL on the floppy disk).

In addition to the full backup sets, you need two incremental 
sets consisting of two or three disks each.  Every day, before 
shutting off the computer, do a daily incremental backup.  This 
will usually add only a small amount of data to the incremental 
set.  After repeated daily backups, the incremental set will 
eventually fill up.  At this time, you can do one of two things.  
If the hard disk has changed significantly since the last full 
backup, then do another full backup.  Otherwise, perform a cleanup 
incremental backup on the second set and rotate the sets so that 
the set on which you just performed the cleanup incremental is the 
one on which future daily incrementals will go.  The old 
incremental set is then no longer needed and should be kept 
idle until the time comes for another cleanup incremental.


\subsubsection{Rules for Safe Backups}

You must remember these rules about safe backups:

\begin{itemize}
  \item Do a full backup every once in a while, rotating full backup 
 disk sets.

  \item Do an incremental backup every day before you turn off the 
 computer.

  \item Back up your hard disk before you endanger it by running a 
 new untested program.

  \item Keep your backup sets well organized and store them in a 
 clean, cool, dry environment away from magnetic fields and 
 other hazards.

\end{itemize}

\subsection{Getting Started -- Performing a Full Backup}

Now that you understand about backup procedures, you are 
ready to begin using \vault.  Boot your machine normally, and 
{\em be sure always to set the clock}.  Incremental backups will not 
work properly unless the clock is {\em always} set correctly whenever 
you are using the machine, for otherwise the file dates will not 
be meaningful.

Copy the files {\tt VAULT.PRG}, {\tt VAULT.RSC}, and {\tt
VAULT.HLP} to your hard disk program folder.  Put your Vault
distribution disk in a safe place and double-click on {\tt VAULT.PRG}.  You
are now standing in \vault, the most sophisticated backup program
that exists for the Atari ST. 


\subsubsection{Preparing the Backup Set}

As described in Section~\ref{orga